package com.hayrullah.cinema.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "Seans_Table")
public class Seans extends AbstractEntity {

	private static final long serialVersionUID = 1L;

	private Date starttime;
	private Date endtime;
	
	@ManyToMany(mappedBy = "seans")
	private Set<Movie> movies;

	public Seans() {
		this.movies = new HashSet<Movie>();

	}

	@Column(name = "Start_time")
	@Temporal(TemporalType.TIME)
	public Date getStarttime() {
		return starttime;
	}

	public void setStarttime(Date starttime) {
		this.starttime = starttime;
	}

	@Column(name = "End_time")
	@Temporal(TemporalType.TIME)
	public Date getEndtime() {
		return endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}

	public Set<Movie> getMovies() {
		return movies;
	}

	public void setMovies(Set<Movie> movies) {
		this.movies = movies;
	}

}
